package com.atguigu.JDBC;

import org.junit.jupiter.api.Test;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.List;

/**
 * @author haoranlu
 * @project IntelliJ IDEA
 */
public class TestEmployeeDAOImp1 {
    EmployeeDAO ed = new EmployeeDAOImp1();
    @Test
    public void test01() throws ParseException {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        String birthday = "2000-03-04";
        Employee emp = new Employee(null,"王八","男","程序员",sdf.parse(birthday));
        ed.addEmployee(emp);
    }
    @Test
    public void test02(){
        Employee emp = ed.getById(1007);
        emp.setTitle("Java工程师");
        ed.updateEmployee(emp);
    }
    @Test
    public void test03(){
        List<Employee> all = ed.getAll();
        all.forEach(System.out::println);
    }
}
